/**
 * 获取url中带的参数
 * @param name
 * @returns {string|null}
 */
function getUrlParameter(name) {
    //没encode或者带#
    var url = window.location.search;
    if (url.indexOf("_encode") > -1) {
        url = decodeURI(window.location.href);
    }
    if (url.split("?").length > 1) {
        url = "?" + url.split("?")[1];
    } else {
        url = "?";
    }
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = url.substr(1).match(reg);
    if (r != null) {
        return decodeURI(r[2]);
    }
    return null;
}